
package com.punch.common.feign.fallback;


import com.punch.common.feign.FeignAreaService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


/**
 * userService降级工场
 *
 * @author zlt
 * @date 2019/1/18
 */

@Slf4j
@Component
public class FeignAreaServiceFallbackFactory implements FallbackFactory<FeignAreaService> {
    @Override
    public FeignAreaService create(Throwable throwable) {
        return new FeignAreaService() {
            /**
             * 获取父ids
             *
             * @param areaId 地区id
             * @return string
             */
            @Override
            public String getParentIds(Integer areaId) {
                log.error("获取父ids异常:{}", areaId, throwable);
                return "";
            }
        };
    }
}

